package com.example.myapplication2.POJO;

import androidx.room.Entity;
import androidx.room.PrimaryKey;



@Entity
public class Book {
    // 书名
    private String bookName;
    // 价格
    private float price;
    // id
    //设置主键,并启用自增
    @PrimaryKey(autoGenerate = true)
    private Long id;

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ", price=" + price +
                ", id=" + id +
                '}';
    }
}
